#ifndef FORMCAM_H
#define FORMCAM_H

#include <QWidget>

#include <QCameraControl>
#include <QCameraImageCapture>
#include <QCameraInfo>
#include <QCamera>
#include <QCameraInfo>
#include <QCameraViewfinder>


#include <QList>
#include <QDebug>
#include <QImage>
#include <QBuffer>
#include <QMediaRecorder>
#include <QTreeWidgetItem>

#include <QHttpMultiPart>
#include <qnetworkreply.h>
#include <qfile.h>

namespace Ui {
class FormCam;
}

class FormCam : public QWidget
{
    Q_OBJECT

public:
    explicit FormCam(QWidget *parent = nullptr);
    ~FormCam();
    //QCamera *camera;//摄像头
    //QCameraViewfinder * viewfinder;//摄像头取景器部件
    //QCameraImageCapture * imageCapture;//截图部件
    QCamera*               mCamera;         //摄像头对象
    QCameraViewfinder*     mViewfinder;     //摄像头取景器
    QCameraImageCapture*   mImageCapture;   //截图对象
    QMediaRecorder*        mMediaRecorder;  //视频录制对象

    QNetworkReply *reply;
signals:
    void  sendData(QString);
public slots:
    void closeEvent (QCloseEvent *event);
    void ShowTheCapture();
    void SavePicture();
    void displayImage(int,QImage image);
    void ListCamera();
    void bindRecoder(QCamera *camera);
    void openCamera(QString description=QString());
private slots:
    void on_cmdStart_clicked();
    void on_cmdStop_clicked();
    void on_cmbCAM_currentIndexChanged(const QString &arg1);
    void on_cmdSavePdf_clicked();
    void on_s_DB_valueChanged(int value);
    void on_s_LD_valueChanged(int value);
    void on_cmdClearList_clicked();
    void on_cmdUP_clicked();
    void on_cmdDel_clicked();
    void on_cmdDown_clicked();


    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);

    void uploadFinished();

    void on_cmdUpfile_clicked();

private:
    Ui::FormCam *ui;
    int JpgCount;
};

#endif // FORMCAM_H
